package edu.kjxy.day02.t19;

/**
 * 功能:优先级具有规则性
 * setPriority设置线程优先级效果展示
 * 优先级和代码执行顺序无关
 * 线程优先级具有一定规则性，CPU尽量将执行资源让给优先级比较高的线程
 * 作者:程序员欧阳子韩
 * 日期:2024/2/1 15:51
 */
public class RunTest {
    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            MyThread1 thread1 = new MyThread1();
            thread1.setPriority(1);
            thread1.start();
            MyThread2 thread2 = new MyThread2();
            thread2.setPriority(10);
            thread2.start();
        }
    }
}
